<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ReduceBy2 / HorizontalReduceBy2 / VerticalReduceBy2 Avisynth Filter</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
</head>
<body >
<h2><a name="ReduceBy2"></a>HorizontalReduceBy2 / VerticalReduceBy2 / ReduceBy2</h2>
<p><code>HorizontalReduceBy2 </code>(<var>clip</var>)<br>
  <code>VerticalReduceBy2 </code>(<var>clip</var>)<br>
  <code>ReduceBy2 </code>(<var>clip</var>)</p>
<p><code>HorizontalReduceBy2</code> reduces the horizontal size of each frame by half,
and <code>VerticalReduceBy2</code> reduces the vertical size by half. Chain them
together (in either order) to reduce the whole image by half. You can also use
the shorthand <code>ReduceBy2</code>, which is the same as <code>HorizontalReduceBy2</code>
followed by <code>VerticalReduceBy2</code>.
</p>
<p>The filter kernel used is (1/4,1/2,1/4), which is the same as in VirtualDub's
"2:1 reduction (high quality)" filter. This avoids the aliasing problems that
occur with a (1/2,1/2) kernel. VirtualDub's "resize" filter uses a third, fancier
kernel for 2:1 reduction, but I experimented with it and found that it actually
produced slightly worse-looking MPEG files--presumably because it sharpens edges
slightly, and most codecs don't like sharp edges.
</p>
<p>If your source video is interlaced, the <code>VerticalReduceBy2</code>
filter will
deinterlace it as a side-effect. If you plan to produce output video in a size
like 320x240, I recommend that you capture at full interlaced vertical resolution
(320x480) and use <code>VerticalReduceBy2</code>. You will get much better-looking
output. My Huffyuv
utility will compress captured video about 2:1, losslessly, so you can capture
320x480 in about the same space as it used to take to capture 320x240. (If your
disk has the capacity and throughput to support it, you can even capture at
640x480 and use both <code>HorizontalReduceBy2</code> and <code>VerticalReduceBy2</code>.
But this won't improve the quality as much, and if you have to go to MotionJPEG
to achieve 640x480, you're probably better off with Huffyuv at 320x480.)
</p>
<p>
<p><kbd>$Date: 2005/10/03 16:49:04 $</kbd></p>
<FORM>
<INPUT TYPE="Button" VALUE="Back"
onClick="history.go(-1)">
</form>
</body>
</html>
